
package com.joysuch.wwyt.datadump.biz.model;

import java.util.Date;

import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.zlg.common.datadump.annotation.DataDumpEntity;
import cn.zlg.common.datadump.annotation.DataDumpField;
import com.joysuch.wwyt.bp.entity.dsl.QBpDepart;
import com.joysuch.wwyt.bp.entity.dsl.QBpEnterpriseInfo;
import com.joysuch.wwyt.bp.entity.dsl.QBpJob;
import com.joysuch.wwyt.core.entity.dsl.QBaseConfig;
import com.joysuch.wwyt.core.entity.dsl.QBaseLoginAccount;
import com.joysuch.wwyt.core.entity.dsl.QBaseTypeGroupItem;
import com.joysuch.wwyt.core.entity.dsl.QBaseUser;
import com.joysuch.wwyt.datadump.biz.convertor.ExportBaseUserIdCardTypeConvertor;
import com.joysuch.wwyt.datadump.biz.convertor.ExportBaseUserRoleConvertor;
import com.joysuch.wwyt.datadump.biz.convertor.ImportBaseUserIdCardTypeConvertor;
import com.joysuch.wwyt.datadump.biz.convertor.ImportBaseUserRoleConvertor;
import com.joysuch.wwyt.datadump.biz.query.BaseUserDumpQueryBean;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

@DataDumpEntity(name = "user-dump", entity = QBaseUser.class, exportQueryConditions = BaseUserDumpQueryBean.class,
        businessName = "人员档案", batchDeleteField = "state", deleteFlagValue = "44")
@Data
public class BaseUserDumpBean {

    @Excel(name = "工号", width = 15)
    @Length(max = 10)
    @DataDumpField(field = "code")
    private String workNo;

    @Excel(name = "人员姓名", width = 15)
    @DataDumpField(field = "realName")
    private String name;

    @Excel(name = "身份")
    @DataDumpField(field = "role", importConvertors = ImportBaseUserRoleConvertor.class, exportConvertors = ExportBaseUserRoleConvertor.class)
    private String role;

    @Excel(name = "工作单位", width = 16)
    @DataDumpField(field = "workCompanyId", referenceEntity = QBpEnterpriseInfo.class, referenceEntityField = "name", useJoin = true)
    private String workCompany;

    @Excel(name = "部门", width = 20)
    @DataDumpField(field = "departId", referenceEntity = QBpDepart.class, referenceEntityField = "name", useJoin = true)
    private String depart;

    @Excel(name = "岗位", width = 16)
    @DataDumpField(field = "job", referenceEntity = QBpJob.class, referenceEntityField = "name")
    private String job;

    @Excel(name = "定位卡号", width = 20)
    @DataDumpField(field = "sn")
    private String sn;

    @Excel(name = "门禁卡号")
    @DataDumpField(field = "cardNumber")
    private String passCardNo;

    //头像图标
    @Excel(name = "地图显示图标")
    @DataDumpField(field = "capId")
    private Long capId;

    //报警模板
    @Length(max = 100)
    @Excel(name = "报警模板", width = 20)
    @DataDumpField(field = "alarmTemplateName")
    private String alarmTemplateName;

    @Excel(name = "账号")
    @DataDumpField(field = "id", referenceEntity = QBaseLoginAccount.class, referenceEntityField = "userName", referenceEntityIdField = "baseUser.id")
    private String loginAccount;

    @Excel(name = "性别", width = 8)
    @DataDumpField(field = "gender")
    private String gender;

    @Excel(name = "进入本单位日期", width = 8, format = "yyyy-MM-dd")
    @DataDumpField(field = "enterDate")
    private Date enterDate;

    @Excel(name = "出生年月", width = 8, format = "yyyy-MM-dd")
    @DataDumpField(field = "birthday")
    private Date birthday;

    @Excel(name = "民族")
    @DataDumpField(field = "nation", referenceEntity = QBaseTypeGroupItem.class, referenceEntityField = "name")
    private String nation;

    @Excel(name = "证件类型")
    @DataDumpField(field = "idCardType", importConvertors = ImportBaseUserIdCardTypeConvertor.class, exportConvertors = ExportBaseUserIdCardTypeConvertor.class)
    private String idCardType;

    @Excel(name = "证件号码", width = 20)
    @DataDumpField(field = "idCardNo")
    private String idCardNo;

    @Excel(name = "联系电话", width = 15)
    @DataDumpField(field = "telephone")
    private String phone;

    @Excel(name = "办公电话", width = 15)
    @DataDumpField(field = "officePhone")
    private String officePhone;

    @Excel(name = "邮箱")
    @DataDumpField(field = "email")
    private String email;

    @Excel(name = "健康状况")
    @DataDumpField(field = "healthStatus", referenceEntity = QBaseTypeGroupItem.class, referenceEntityField = "name")
    private String health;

    @Excel(name = "学历")
    @DataDumpField(field = "education", referenceEntity = QBaseTypeGroupItem.class, referenceEntityField = "name")
    private String education;

    @Excel(name = "专业")
    @DataDumpField(field = "major")
    private String major;

    @Excel(name = "户籍所在地")
    @DataDumpField(field = "census")
    private String censusRegister;

    @Excel(name = "通讯地址")
    @DataDumpField(field = "address")
    private String address;

    @Excel(name = "邮编")
    @DataDumpField(field = "postcode")
    private String postcode;

    @Excel(name = "参加工作时间" , width = 8, format = "yyyy-MM-dd")
    @DataDumpField(field = "joinWorkDate")
    private Date joinWorkDate;

    @Excel(name = "职称/技能等级")
    @DataDumpField(field = "title")
    private String title;

    @Excel(name = "职务")
    @DataDumpField(field = "duty")
    private String duty;

    @Excel(name = "工作职责")
    @DataDumpField(field = "jobDuty")
    private String jobDuty;

    @Excel(name = "工作经历")
    @DataDumpField(field = "jobHistory")
    private String jobHistory;

    @Excel(name = "人员类型")
    @DataDumpField(field = "personTypeId", referenceEntity = QBaseTypeGroupItem.class, referenceEntityField = "name")
    private String personTypeId;

    @Excel(name = "IMEI")
    @DataDumpField(field = "IMEI")
    private String IMEI;
}
